package com.jxsd.edu.cn.struts2.actions;

import com.jxsd.edu.cn.struts2.models.Reply;
import com.jxsd.edu.cn.struts2.serviceImpl.ReplyServiceImpl;
import com.jxsd.edu.cn.struts2.services.ReplyService;
import com.opensymphony.xwork2.ActionContext;
/**
 * 处理回帖请求
 * */
public class ReplyAction 
{
	private   Reply  reply;
	
	private  ReplyService  replySerice=new  ReplyServiceImpl();
    /**
     *增加一条帖子 
     * */
	public   String  addReply()
	{
		Integer  userId=(Integer)ActionContext.getContext().getSession().get("userId");
		reply.setUserID(userId);
		replySerice.addReply(reply);
		
		return  "success";
	}
	public Reply getReply() {
		return reply;
	}
	public void setReply(Reply reply) {
		this.reply = reply;
	}
}
